﻿using UnityEngine;
using System.Collections;

//public class Helper : MonoBehaviour {
public static class Helper {
	
	// Checks which game is pointed
	public static bool CheckTouch(GameObject go) {
		RaycastHit hit;
		foreach(Touch touch in Input.touches) {
			if(touch.phase == TouchPhase.Began) {
				// Construct a ray from the current touch coordinates
				Ray ray = Camera.main.ScreenPointToRay(touch.position);
				if( Physics.Raycast(ray, out hit) ) { // Check hit
					if(hit.transform.gameObject == go) {
						//OnMouseDown(); // for testing...
						return true;
					}
				}
			}
		}
		return false;
	}
}
